package cn.wolfcode.service.impl;

import cn.wolfcode.domain.BulletMsg;
import cn.wolfcode.mapper.BulletMsgMapper;
import cn.wolfcode.service.IBulletMsgService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BulletMsgServiceImpl implements IBulletMsgService {

    private final BulletMsgMapper mapper;

    public BulletMsgServiceImpl(BulletMsgMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public void save(BulletMsg obj) {
        mapper.insert(obj);
    }

    @Override
    public void updateById(BulletMsg obj) {
        mapper.updateByPrimaryKey(obj);
    }

    @Override
    public void deleteById(Long id) {
        mapper.deleteByPrimaryKey(id);
    }

    @Override
    public BulletMsg findById(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<BulletMsg> findAll() {
        return mapper.selectAll();
    }
}
